import requests
import json
def get_trans_data(word=None):
    url="http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule"
    form_data = {"i": word, "from": "AUTO",
		"to": "AUTO",
		"smartresult": "dict",
		"client": "fanyideskweb",
		"salt": "15691428561472",
		"sign": "c02271a5f3c62ccbb1ee1a901cafc478",
		"ts": "1569142856147",
		"bv": "e2a78ed30c66e16a857c5b6486a1d326",
		"doctype": "json",
		"version": "2.1",
		"keyfrom": "fanyi.web",
		"action": "FY_BY_CLICKBUTTION"
	}
    print(form_data)
    response = requests.post(url, form_data)
    print(json.loads(response.text))
if __name__=='__main__':
    get_trans_data('中国')
